package com.woniuxy;


import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.util.concurrent.CountDownLatch;

/**
 * @Author: 马宇航
 * @Todo: TODO
 * @DateTime: 01/19/0019 上午 11:15
 * @Component: 成都蜗牛学苑
 **/
public class TestMy {
    public static void main(String[] args) throws InterruptedException {
        CountDownLatch countDownLatch = new CountDownLatch(100000);
        for (int i = 0; i <100000 ; i++) {
            new Thread(()->{
               Chinese.i.decrementAndGet();
//                countDownLatch.countDown();
            }).start();
        }
//        countDownLatch.await();
        Thread.sleep(10);
        System.out.println("商品剩余数量："+Chinese.i);
    }
}
